define(["dojo/_base/declare", "dijit/form/Form", "dijit/form/TextBox", "dijit/form/Button"], function(declare){
    declare("my.form.EditConcreteGradeForm", [dijit.form.Form], {
    	startup : function(){
    		console.log("Jestem w formie");
    		var gradeId = dijit.byId("editeConcreteGradeDialog").getValue();
    		
    		dijit.byId("degree.id").setValue(gradeId);
    		
    		dojo.xhrPost(
				    {
				        url : "getDegreeByIdAction.action?degree.id="+gradeId,
				        handleAs : "json",
				        load : dojo.hitch(this, this.onLoadDegree),
				    });
    	},
    	
    	onLoadDegree : function(responseObject, ioArgs){
    		dijit.byId("degreevalueEdit").set("value", responseObject.degree.degreevalue);
    		dijit.byId("degree.degreename").set("value", responseObject.degree.degreename);
    		dijit.byId("degree.description").set("value", responseObject.degree.description);
    	},
    	
    	onSubmit : function(){
			return this.isValid() && dijit.byId("degreevalueEdit").isValid();
		}
    	
    });
});